# WS client example

import asyncio
import websockets


async def hello():
    name = "terry"

    async with websockets.connect('ws://localhost:8080/websocket/'+name) as websocket:
        while True:
            number = input("What's your number? ")
            if number != 'Q':
                await websocket.send(number)
                greeting = await websocket.recv()
                print(f"< {greeting}")
            else:
                break

asyncio.get_event_loop().run_until_complete(hello())
# hello()
print("it's over")
